home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 12 / BBS in a box XII-1.iso / Files / System7 tools / G-L / LoadADrive 1.0.sit / LoadADrive / C Source Code / LoadADrive.c next >
MacBinary  |  1994-03-28  |  7.4 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, Mon Mar 28 10:17:17 1994, modified Mon Mar 28 10:17:17 1994, creator 'MPS ', type ASCII, 6825 bytes "LoadADrive.c" , at 0x1b29 428 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0c 4c 6f 61 64 41 44 | 72 69 76 65 2e 63 00 00 |..LoadAD|rive.c..|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 00 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 1a a9 00 | 00 01 ac a9 bc a5 7d a9 |........|......}.|
|00000060| bc a5 7d 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..}.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ab 7d 00 00 |........|.....}..|
|00000080| 2f 2f 20 53 6f 75 72 63 | 65 20 43 6f 64 65 3a 20 |// Sourc|e Code: |
|00000090| 28 63 29 20 44 69 65 74 | 65 72 20 53 70 61 61 72 |(c) Diet|er Spaar|
|000000a0| 0d 0d 2f 2f 20 46 72 65 | 65 77 61 72 65 2c 20 62 |..// Fre|eware, b|
|000000b0| 75 74 20 63 6f 6d 6d 65 | 72 63 69 61 6c 20 75 73 |ut comme|rcial us|
|000000c0| 65 20 6d 75 73 74 20 62 | 65 20 6c 69 63 65 6e 73 |e must b|e licens|
|000000d0| 65 64 0d 0d 2f 2f 20 49 | 6e 74 65 72 6e 65 74 3a |ed..// I|nternet:|
|000000e0| 20 73 70 61 61 72 40 6d | 69 72 69 64 65 72 2e 61 | spaar@m|irider.a|
|000000f0| 62 67 2e 73 75 62 2e 6f | 72 67 0d 0d 2f 2f 20 44 |bg.sub.o|rg..// D|
|00000100| 69 65 74 65 72 20 53 70 | 61 61 72 0d 2f 2f 20 53 |ieter Sp|aar.// S|
|00000110| 63 68 6e 65 72 7a 68 6f | 66 65 72 20 53 74 72 2e |chnerzho|fer Str.|
|00000120| 20 32 0d 2f 2f 20 38 36 | 38 36 35 20 4d 61 72 6b | 2.// 86|865 Mark|
|00000130| 74 20 57 61 6c 64 0d 2f | 2f 20 47 65 72 6d 61 6e |t Wald./|/ German|
|00000140| 79 0d 0d 0d 2f 2f 20 4d | 50 57 20 76 65 72 73 69 |y...// M|PW versi|
|00000150| 6f 6e 2c 20 75 73 65 20 | 74 68 65 20 66 6f 6c 6c |on, use |the foll|
|00000160| 6f 77 69 6e 67 20 63 6f | 6d 6d 61 6e 64 3a 0d 0d |owing co|mmand:..|
|00000170| 2f 2f 20 52 65 7a 20 4c | 6f 61 64 41 44 72 69 76 |// Rez L|oadADriv|
|00000180| 65 2e 52 20 2d 61 70 70 | 65 6e 64 20 2d 6f 20 4c |e.R -app|end -o L|
|00000190| 6f 61 64 41 44 72 69 76 | 65 0d 2f 2f 20 43 20 4c |oadADriv|e.// C L|
|000001a0| 6f 61 64 41 44 72 69 76 | 65 2e 63 20 2d 62 20 2d |oadADriv|e.c -b -|
|000001b0| 6d 62 67 20 6f 6e 20 2d | 73 79 6d 20 6f 6e 20 2d |mbg on -|sym on -|
|000001c0| 6f 70 74 20 6f 66 66 20 | 2d 77 61 72 6e 69 6e 67 |opt off |-warning|
|000001d0| 73 20 6f 6e 20 2d 72 0d | 2f 2f 20 4c 69 6e 6b 20 |s on -r.|// Link |
|000001e0| 2d 73 79 6d 20 6f 6e 20 | 2d 6c 20 2d 74 20 41 50 |-sym on |-l -t AP|
|000001f0| 50 4c 20 2d 63 20 27 44 | 53 4c 44 27 20 2d 6d 73 |PL -c 'D|SLD' -ms|
|00000200| 67 20 64 75 70 2c 6d 75 | 6c 74 69 70 6c 65 2c 77 |g dup,mu|ltiple,w|
|00000210| 61 72 6e 20 2d 72 61 20 | 25 41 35 49 6e 69 74 3d |arn -ra |%A5Init=|
|00000220| 72 65 73 50 72 65 6c 6f | 61 64 2c 72 65 73 4c 6f |resPrelo|ad,resLo|
|00000230| 63 6b 65 64 20 4c 6f 61 | 64 41 44 72 69 76 65 2e |cked Loa|dADrive.|
|00000240| 43 2e 6f 20 22 7b 4c 69 | 62 72 61 72 69 65 73 7d |C.o "{Li|braries}|
|00000250| 22 52 75 6e 74 69 6d 65 | 2e 6f 20 22 7b 4c 69 62 |"Runtime|.o "{Lib|
|00000260| 72 61 72 69 65 73 7d 22 | 49 6e 74 65 72 66 61 63 |raries}"|Interfac|
|00000270| 65 2e 6f 20 22 7b 43 4c | 69 62 72 61 72 69 65 73 |e.o "{CL|ibraries|
|00000280| 7d 22 53 74 64 43 4c 69 | 62 2e 6f 20 2d 6f 20 4c |}"StdCLi|b.o -o L|
|00000290| 6f 61 64 41 44 72 69 76 | 65 20 3e 20 4d 41 49 4e |oadADriv|e > MAIN|
|000002a0| 2e 4d 41 50 0d 2f 2f 20 | 53 65 74 46 69 6c 65 20 |.MAP.// |SetFile |
|000002b0| 2d 61 20 42 69 20 2d 64 | 20 2e 20 2d 6d 20 2e 20 |-a Bi -d| . -m . |
|000002c0| 4c 6f 61 64 41 44 72 69 | 76 65 20 0d 0d 0d 23 69 |LoadADri|ve ...#i|
|000002d0| 6e 63 6c 75 64 65 20 09 | 3c 4d 65 6d 6f 72 79 2e |nclude .|<Memory.|
|000002e0| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 09 3c 52 65 |h>.#incl|ude .<Re|
|000002f0| 73 6f 75 72 63 65 73 2e | 68 3e 0d 23 69 6e 63 6c |sources.|h>.#incl|
|00000300| 75 64 65 09 3c 46 6f 6e | 74 73 2e 68 3e 0d 23 69 |ude.<Fon|ts.h>.#i|
|00000310| 6e 63 6c 75 64 65 09 3c | 54 6f 6f 6c 55 74 69 6c |nclude.<|ToolUtil|
|00000320| 73 2e 68 3e 0d 23 69 6e | 63 6c 75 64 65 09 3c 45 |s.h>.#in|clude.<E|
|00000330| 76 65 6e 74 73 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |vents.h>|.#includ|
|00000340| 65 09 3c 57 69 6e 64 6f | 77 73 2e 68 3e 0d 23 69 |e.<Windo|ws.h>.#i|
|00000350| 6e 63 6c 75 64 65 09 3c | 44 69 61 6c 6f 67 73 2e |nclude.<|Dialogs.|
|00000360| 68 3e 0d 23 69 6e 63 6c | 75 64 65 09 3c 43 6f 6e |h>.#incl|ude.<Con|
|00000370| 74 72 6f 6c 73 2e 68 3e | 0d 23 69 6e 63 6c 75 64 |trols.h>|.#includ|
|00000380| 65 09 3c 50 61 63 6b 61 | 67 65 73 2e 68 3e 0d 23 |e.<Packa|ges.h>.#|
|00000390| 69 6e 63 6c 75 64 65 09 | 3c 4d 65 6e 75 73 2e 68 |include.|<Menus.h|
|000003a0| 3e 0d 23 69 6e 63 6c 75 | 64 65 09 3c 53 74 72 69 |>.#inclu|de.<Stri|
|000003b0| 6e 67 73 2e 68 3e 0d 23 | 69 6e 63 6c 75 64 65 20 |ngs.h>.#|include |
|000003c0| 09 3c 47 65 73 74 61 6c | 74 45 71 75 2e 68 3e 0d |.<Gestal|tEqu.h>.|
|000003d0| 23 69 6e 63 6c 75 64 65 | 20 09 3c 53 74 61 6e 64 |#include| .<Stand|
|000003e0| 61 72 64 46 69 6c 65 2e | 68 3e 0d 23 69 6e 63 6c |ardFile.|h>.#incl|
|000003f0| 75 64 65 09 3c 41 6c 69 | 61 73 65 73 2e 68 3e 0d |ude.<Ali|ases.h>.|
|00000400| 23 69 6e 63 6c 75 64 65 | 09 3c 46 69 6c 65 73 2e |#include|.<Files.|
|00000410| 68 3e 0d 23 69 6e 63 6c | 75 64 65 09 3c 44 65 76 |h>.#incl|ude.<Dev|
|00000420| 69 63 65 73 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |ices.h>.|#include|
|00000430| 09 3c 50 4c 53 74 72 69 | 6e 67 46 75 6e 63 73 2e |.<PLStri|ngFuncs.|
|00000440| 68 3e 0d 23 69 6e 63 6c | 75 64 65 20 09 3c 53 74 |h>.#incl|ude .<St|
|00000450| 64 41 72 67 2e 68 3e 0d | 23 69 6e 63 6c 75 64 65 |dArg.h>.|#include|
|00000460| 20 09 3c 53 74 64 49 4f | 2e 68 3e 0d 23 69 6e 63 | .<StdIO|.h>.#inc|
|00000470| 6c 75 64 65 20 09 3c 53 | 74 64 4c 69 62 2e 68 3e |lude .<S|tdLib.h>|
|00000480| 0d 0d 2f 2a 20 73 6f 6d | 65 20 63 6f 6d 6d 6f 6e |../* som|e common|
|00000490| 20 63 6f 6e 73 74 61 6e | 74 73 20 2a 2f 0d 0d 23 | constan|ts */..#|
|000004a0| 64 65 66 69 6e 65 20 54 | 52 55 45 09 74 72 75 65 |define T|RUE.true|
|000004b0| 0d 23 64 65 66 69 6e 65 | 20 46 41 4c 53 45 09 66 |.#define| FALSE.f|
|000004c0| 61 6c 73 65 0d 23 64 65 | 66 69 6e 65 20 4e 49 4c |alse.#de|fine NIL|
|000004d0| 09 09 6e 69 6c 0d 0d 2f | 2a 20 63 6f 6e 73 74 61 |..nil../|* consta|
|000004e0| 6e 74 73 20 66 6f 72 20 | 63 6f 6d 70 69 6c 65 72 |nts for |compiler|
|000004f0| 20 69 6e 64 65 70 65 6e | 64 65 6e 63 79 20 2a 2f | indepen|dency */|
|00000500| 0d 2f 2a 20 68 65 72 65 | 20 74 68 65 20 4d 50 57 |./* here| the MPW|
|00000510| 20 43 2d 43 6f 6d 70 69 | 6c 65 72 20 2a 2f 0d 0d | C-Compi|ler */..|
|00000520| 23 64 65 66 69 6e 65 20 | 53 54 41 54 49 43 20 73 |#define |STATIC s|
|00000530| 74 61 74 69 63 0d 23 64 | 65 66 69 6e 65 20 45 58 |tatic.#d|efine EX|
|00000540| 54 45 52 4e 20 65 78 74 | 65 72 6e 0d 23 64 65 66 |TERN ext|ern.#def|
|00000550| 69 6e 65 20 52 45 47 49 | 53 54 45 52 20 72 65 67 |ine REGI|STER reg|
|00000560| 69 73 74 65 72 0d 23 64 | 65 66 69 6e 65 20 56 4f |ister.#d|efine VO|
|00000570| 49 44 20 76 6f 69 64 0d | 23 64 65 66 69 6e 65 20 |ID void.|#define |
|00000580| 42 59 54 45 20 63 68 61 | 72 0d 23 64 65 66 69 6e |BYTE cha|r.#defin|
|00000590| 65 20 57 4f 52 44 20 73 | 68 6f 72 74 0d 23 64 65 |e WORD s|hort.#de|
|000005a0| 66 69 6e 65 20 4c 4f 4e | 47 20 6c 6f 6e 67 0d 23 |fine LON|G long.#|
|000005b0| 64 65 66 69 6e 65 20 42 | 4f 4f 4c 20 42 6f 6f 6c |define B|OOL Bool|
|000005c0| 65 61 6e 0d 23 64 65 66 | 69 6e 65 20 55 42 59 54 |ean.#def|ine UBYT|
|000005d0| 45 20 75 6e 73 69 67 6e | 65 64 20 63 68 61 72 0d |E unsign|ed char.|
|000005e0| 23 64 65 66 69 6e 65 20 | 55 57 4f 52 44 20 75 6e |#define |UWORD un|
|000005f0| 73 69 67 6e 65 64 20 73 | 68 6f 72 74 0d 23 64 65 |signed s|hort.#de|
|00000600| 66 69 6e 65 20 55 4c 4f | 4e 47 20 75 6e 73 69 67 |fine ULO|NG unsig|
|00000610| 6e 65 64 20 6c 6f 6e 67 | 0d 0d 2f 2a 20 52 65 73 |ned long|../* Res|
|00000620| 6f 75 72 63 65 20 2a 2f | 0d 0d 2f 2a 20 41 4c 52 |ource */|../* ALR|
|00000630| 54 20 2a 2f 0d 0d 23 64 | 65 66 69 6e 65 20 45 72 |T */..#d|efine Er|
|00000640| 72 6f 72 41 6c 65 72 74 | 09 31 32 38 0d 0d 2f 2a |rorAlert|.128../*|
|00000650| 20 61 6c 69 73 20 2a 2f | 0d 0d 23 64 65 66 69 6e | alis */|..#defin|
|00000660| 65 20 49 4e 49 54 5f 41 | 4c 49 41 53 09 31 32 38 |e INIT_A|LIAS.128|
|00000670| 0d 0d 2f 2a 20 53 54 52 | 20 2a 2f 0d 0d 23 64 65 |../* STR| */..#de|
|00000680| 66 69 6e 65 20 44 72 69 | 76 65 72 4e 61 6d 65 09 |fine Dri|verName.|
|00000690| 31 32 38 0d 0d 56 4f 49 | 44 20 65 70 72 69 6e 74 |128..VOI|D eprint|
|000006a0| 66 28 42 59 54 45 20 2a | 66 6f 72 6d 61 74 2c 2e |f(BYTE *|format,.|
|000006b0| 2e 2e 29 0d 7b 0d 09 42 | 59 54 45 20 62 75 66 5b |..).{..B|YTE buf[|
|000006c0| 34 30 30 5d 3b 0d 09 76 | 61 5f 6c 69 73 74 20 61 |400];..v|a_list a|
|000006d0| 72 67 3b 0d 09 0d 09 76 | 61 5f 73 74 61 72 74 28 |rg;....v|a_start(|
|000006e0| 61 72 67 2c 66 6f 72 6d | 61 74 29 3b 0d 09 76 73 |arg,form|at);..vs|
|000006f0| 70 72 69 6e 74 66 28 62 | 75 66 2c 66 6f 72 6d 61 |printf(b|uf,forma|
|00000700| 74 2c 61 72 67 29 3b 0d | 09 76 61 5f 65 6e 64 28 |t,arg);.|.va_end(|
|00000710| 61 72 67 29 3b 0d 09 0d | 09 63 32 70 73 74 72 28 |arg);...|.c2pstr(|
|00000720| 62 75 66 29 3b 0d 09 50 | 61 72 61 6d 54 65 78 74 |buf);..P|aramText|
|00000730| 28 62 75 66 2c 22 22 2c | 22 22 2c 22 22 29 3b 0d |(buf,"",|"","");.|
|00000740| 09 4e 6f 74 65 41 6c 65 | 72 74 28 45 72 72 6f 72 |.NoteAle|rt(Error|
|00000750| 41 6c 65 72 74 2c 4e 49 | 4c 29 3b 0d 7d 0d 0d 2f |Alert,NI|L);.}../|
|00000760| 2a 20 67 65 74 20 66 69 | 6c 65 6e 61 6d 65 20 2a |* get fi|lename *|
|00000770| 2f 0d 0d 42 4f 4f 4c 20 | 47 65 74 46 69 6c 65 6e |/..BOOL |GetFilen|
|00000780| 61 6d 65 28 42 59 54 45 | 20 2a 6e 61 6d 65 2c 57 |ame(BYTE| *name,W|
|00000790| 4f 52 44 20 2a 76 52 65 | 66 4e 75 6d 29 0d 7b 0d |ORD *vRe|fNum).{.|
|000007a0| 09 50 6f 69 6e 74 20 77 | 68 65 72 65 3b 0d 09 53 |.Point w|here;..S|
|000007b0| 46 52 65 70 6c 79 20 72 | 65 70 6c 79 3b 0d 09 53 |FReply r|eply;..S|
|000007c0| 46 54 79 70 65 4c 69 73 | 74 20 74 79 70 65 4c 69 |FTypeLis|t typeLi|
|000007d0| 73 74 3b 0d 09 0d 09 77 | 68 65 72 65 2e 76 3d 35 |st;....w|here.v=5|
|000007e0| 30 3b 0d 09 77 68 65 72 | 65 2e 68 3d 37 30 3b 0d |0;..wher|e.h=70;.|
|000007f0| 09 74 79 70 65 4c 69 73 | 74 5b 30 5d 3d 27 49 4e |.typeLis|t[0]='IN|
|00000800| 49 54 27 3b 0d 09 53 46 | 47 65 74 46 69 6c 65 28 |IT';..SF|GetFile(|
|00000810| 77 68 65 72 65 2c 22 22 | 2c 4e 49 4c 2c 31 2c 74 |where,""|,NIL,1,t|
|00000820| 79 70 65 4c 69 73 74 2c | 4e 49 4c 2c 26 72 65 70 |ypeList,|NIL,&rep|
|00000830| 6c 79 29 3b 0d 09 50 4c | 73 74 72 63 70 79 28 6e |ly);..PL|strcpy(n|
|00000840| 61 6d 65 2c 26 72 65 70 | 6c 79 2e 66 4e 61 6d 65 |ame,&rep|ly.fName|
|00000850| 29 3b 0d 09 2a 76 52 65 | 66 4e 75 6d 3d 72 65 70 |);..*vRe|fNum=rep|
|00000860| 6c 79 2e 76 52 65 66 4e | 75 6d 3b 0d 09 0d 09 72 |ly.vRefN|um;....r|
|00000870| 65 74 75 72 6e 20 72 65 | 70 6c 79 2e 67 6f 6f 64 |eturn re|ply.good|
|00000880| 3b 0d 7d 0d 0d 2f 2a 20 | 43 72 65 61 74 65 20 41 |;.}../* |Create A|
|00000890| 6c 69 61 73 20 6f 66 20 | 66 69 6c 65 20 61 6e 64 |lias of |file and|
|000008a0| 20 73 74 6f 72 65 20 69 | 74 20 69 6e 20 74 68 65 | store i|t in the|
|000008b0| 20 72 65 73 6f 75 72 63 | 65 20 66 6f 72 6b 20 2a | resourc|e fork *|
|000008c0| 2f 0d 0d 42 4f 4f 4c 20 | 4d 61 6b 65 4d 79 41 6c |/..BOOL |MakeMyAl|
|000008d0| 69 61 73 28 56 4f 49 44 | 29 0d 7b 0d 09 57 4f 52 |ias(VOID|).{..WOR|
|000008e0| 44 20 76 52 65 66 4e 75 | 6d 3b 0d 09 53 74 72 36 |D vRefNu|m;..Str6|
|000008f0| 33 20 66 4e 61 6d 65 3b | 0d 09 46 53 53 70 65 63 |3 fName;|..FSSpec|
|00000900| 20 66 53 70 65 63 3b 0d | 09 4f 53 45 72 72 20 65 | fSpec;.|.OSErr e|
|00000910| 72 72 3b 0d 09 41 6c 69 | 61 73 48 61 6e 64 6c 65 |rr;..Ali|asHandle|
|00000920| 20 61 6c 69 61 73 3b 0d | 09 48 61 6e 64 6c 65 20 | alias;.|.Handle |
|00000930| 68 3b 0d 09 0d 09 2f 2f | 20 67 65 74 20 66 69 6c |h;....//| get fil|
|00000940| 65 6e 61 6d 65 0d 09 0d | 09 69 66 28 20 21 47 65 |ename...|.if( !Ge|
|00000950| 74 46 69 6c 65 6e 61 6d | 65 28 66 4e 61 6d 65 2c |tFilenam|e(fName,|
|00000960| 26 76 52 65 66 4e 75 6d | 29 20 29 0d 09 09 72 65 |&vRefNum|) )...re|
|00000970| 74 75 72 6e 20 46 41 4c | 53 45 3b 0d 0d 09 2f 2f |turn FAL|SE;...//|
|00000980| 20 6d 61 6b 65 20 46 53 | 53 70 65 63 0d 09 0d 09 | make FS|Spec....|
|00000990| 65 72 72 3d 46 53 4d 61 | 6b 65 46 53 53 70 65 63 |err=FSMa|keFSSpec|
|000009a0| 28 76 52 65 66 4e 75 6d | 2c 30 2c 66 4e 61 6d 65 |(vRefNum|,0,fName|
|000009b0| 2c 26 66 53 70 65 63 29 | 3b 0d 09 69 66 28 20 65 |,&fSpec)|;..if( e|
|000009c0| 72 72 21 3d 6e 6f 45 72 | 72 20 29 20 7b 0d 09 09 |rr!=noEr|r ) {...|
|000009d0| 65 70 72 69 6e 74 66 28 | 22 45 72 72 6f 72 20 63 |eprintf(|"Error c|
|000009e0| 72 65 61 74 69 6e 67 20 | 46 53 53 70 65 63 2e 5c |reating |FSSpec.\|
|000009f0| 6e 28 65 72 72 3d 25 64 | 29 22 2c 65 72 72 29 3b |n(err=%d|)",err);|
|00000a00| 0d 09 09 72 65 74 75 72 | 6e 20 46 41 4c 53 45 3b |...retur|n FALSE;|
|00000a10| 0d 09 7d 0d 09 0d 09 2f | 2f 20 63 72 65 61 74 65 |..}..../|/ create|
|00000a20| 20 61 6c 69 61 73 0d 09 | 0d 09 65 72 72 3d 4e 65 | alias..|..err=Ne|
|00000a30| 77 41 6c 69 61 73 28 4e | 49 4c 2c 26 66 53 70 65 |wAlias(N|IL,&fSpe|
|00000a40| 63 2c 26 61 6c 69 61 73 | 29 3b 0d 09 69 66 28 20 |c,&alias|);..if( |
|00000a50| 65 72 72 21 3d 6e 6f 45 | 72 72 20 29 20 7b 0d 09 |err!=noE|rr ) {..|
|00000a60| 09 65 70 72 69 6e 74 66 | 28 22 45 72 72 6f 72 20 |.eprintf|("Error |
|00000a70| 63 72 65 61 74 69 6e 67 | 20 41 6c 69 61 73 2e 5c |creating| Alias.\|
|00000a80| 6e 28 65 72 72 3d 25 64 | 29 22 2c 65 72 72 29 3b |n(err=%d|)",err);|
|00000a90| 0d 09 09 72 65 74 75 72 | 6e 20 46 41 4c 53 45 3b |...retur|n FALSE;|
|00000aa0| 0d 09 7d 0d 09 0d 09 2f | 2f 20 64 65 6c 65 74 65 |..}..../|/ delete|
|00000ab0| 20 6f 6c 64 20 61 6c 69 | 61 73 20 69 6e 20 72 65 | old ali|as in re|
|00000ac0| 73 6f 75 72 63 65 0d 09 | 0d 09 53 65 74 52 65 73 |source..|..SetRes|
|00000ad0| 4c 6f 61 64 28 46 41 4c | 53 45 29 3b 0d 09 68 3d |Load(FAL|SE);..h=|
|00000ae0| 47 65 74 31 52 65 73 6f | 75 72 63 65 28 72 41 6c |Get1Reso|urce(rAl|
|00000af0| 69 61 73 54 79 70 65 2c | 49 4e 49 54 5f 41 4c 49 |iasType,|INIT_ALI|
|00000b00| 41 53 29 3b 0d 09 53 65 | 74 52 65 73 4c 6f 61 64 |AS);..Se|tResLoad|
|00000b10| 28 54 52 55 45 29 3b 0d | 09 0d 09 69 66 28 68 21 |(TRUE);.|...if(h!|
|00000b20| 3d 4e 49 4c 20 26 26 20 | 52 65 73 45 72 72 6f 72 |=NIL && |ResError|
|00000b30| 28 29 3d 3d 6e 6f 45 72 | 72 29 20 7b 0d 09 09 52 |()==noEr|r) {...R|
|00000b40| 6d 76 65 52 65 73 6f 75 | 72 63 65 28 68 29 3b 0d |mveResou|rce(h);.|
|00000b50| 09 09 65 72 72 3d 52 65 | 73 45 72 72 6f 72 28 29 |..err=Re|sError()|
|00000b60| 3b 0d 09 09 69 66 28 20 | 65 72 72 21 3d 6e 6f 45 |;...if( |err!=noE|
|00000b70| 72 72 20 29 0d 09 09 09 | 65 70 72 69 6e 74 66 28 |rr )....|eprintf(|
|00000b80| 22 43 61 6e 6e 6f 74 20 | 72 65 6d 6f 76 65 20 6f |"Cannot |remove o|
|00000b90| 6c 64 20 41 6c 69 61 73 | 20 66 72 6f 6d 20 72 65 |ld Alias| from re|
|00000ba0| 73 6f 75 72 63 65 20 66 | 6f 72 6b 20 28 6d 61 79 |source f|ork (may|
|00000bb0| 62 65 20 46 69 6c 65 2f | 44 72 69 76 65 20 70 72 |be File/|Drive pr|
|00000bc0| 6f 74 65 63 74 65 64 29 | 2e 5c 6e 28 65 72 72 3d |otected)|.\n(err=|
|00000bd0| 25 64 29 22 2c 65 72 72 | 29 3b 0d 09 7d 0d 09 69 |%d)",err|);..}..i|
|00000be0| 66 28 68 21 3d 4e 49 4c | 29 0d 09 09 44 69 73 70 |f(h!=NIL|)...Disp|
|00000bf0| 6f 73 48 61 6e 64 6c 65 | 28 68 29 3b 0d 09 09 0d |osHandle|(h);....|
|00000c00| 09 2f 2f 20 61 64 64 20 | 61 6c 69 61 73 20 74 6f |.// add |alias to|
|00000c10| 20 72 65 73 6f 75 72 63 | 65 0d 09 0d 09 68 3d 28 | resourc|e....h=(|
|00000c20| 48 61 6e 64 6c 65 29 61 | 6c 69 61 73 3b 0d 09 41 |Handle)a|lias;..A|
|00000c30| 64 64 52 65 73 6f 75 72 | 63 65 28 68 2c 72 41 6c |ddResour|ce(h,rAl|
|00000c40| 69 61 73 54 79 70 65 2c | 49 4e 49 54 5f 41 4c 49 |iasType,|INIT_ALI|
|00000c50| 41 53 2c 22 5c 70 49 6e | 69 74 22 29 3b 0d 09 65 |AS,"\pIn|it");..e|
|00000c60| 72 72 3d 52 65 73 45 72 | 72 6f 72 28 29 3b 0d 09 |rr=ResEr|ror();..|
|00000c70| 69 66 28 65 72 72 21 3d | 6e 6f 45 72 72 29 20 7b |if(err!=|noErr) {|
|00000c80| 0d 09 09 65 70 72 69 6e | 74 66 28 22 45 72 72 6f |...eprin|tf("Erro|
|00000c90| 72 20 61 64 64 69 6e 67 | 20 6e 65 77 20 41 6c 69 |r adding| new Ali|
|00000ca0| 61 73 20 74 6f 20 72 65 | 73 6f 75 72 63 65 20 66 |as to re|source f|
|00000cb0| 6f 72 6b 2e 5c 6e 28 65 | 72 72 3d 25 64 29 22 2c |ork.\n(e|rr=%d)",|
|00000cc0| 65 72 72 29 3b 0d 09 09 | 44 69 73 70 6f 73 48 61 |err);...|DisposHa|
|00000cd0| 6e 64 6c 65 28 68 29 3b | 0d 09 09 72 65 74 75 72 |ndle(h);|...retur|
|00000ce0| 6e 20 46 41 4c 53 45 3b | 0d 09 7d 0d 09 55 70 64 |n FALSE;|..}..Upd|
|00000cf0| 61 74 65 52 65 73 46 69 | 6c 65 28 43 75 72 52 65 |ateResFi|le(CurRe|
|00000d00| 73 46 69 6c 65 28 29 29 | 3b 0d 09 0d 09 65 72 72 |sFile())|;....err|
|00000d10| 3d 52 65 73 45 72 72 6f | 72 28 29 3b 0d 09 69 66 |=ResErro|r();..if|
|00000d20| 28 65 72 72 21 3d 6e 6f | 45 72 72 29 20 7b 0d 09 |(err!=no|Err) {..|
|00000d30| 09 65 70 72 69 6e 74 66 | 28 22 45 72 72 6f 72 20 |.eprintf|("Error |
|00000d40| 75 70 64 61 74 69 6e 67 | 20 72 65 73 6f 75 72 63 |updating| resourc|
|00000d50| 65 20 66 6f 72 6b 2e 5c | 6e 28 65 72 72 3d 25 64 |e fork.\|n(err=%d|
|00000d60| 29 22 2c 65 72 72 29 3b | 0d 09 09 52 65 6c 65 61 |)",err);|...Relea|
|00000d70| 73 65 52 65 73 6f 75 72 | 63 65 28 68 29 3b 0d 09 |seResour|ce(h);..|
|00000d80| 09 72 65 74 75 72 6e 20 | 46 41 4c 53 45 3b 0d 09 |.return |FALSE;..|
|00000d90| 7d 0d 09 52 65 6c 65 61 | 73 65 52 65 73 6f 75 72 |}..Relea|seResour|
|00000da0| 63 65 28 68 29 3b 0d 0d | 09 72 65 74 75 72 6e 20 |ce(h);..|.return |
|00000db0| 54 52 55 45 3b 0d 7d 0d | 0d 2f 2a 20 52 65 73 6f |TRUE;.}.|./* Reso|
|00000dc0| 6c 76 65 20 66 69 6c 65 | 20 61 6c 69 61 73 20 2a |lve file| alias *|
|00000dd0| 2f 0d 0d 42 4f 4f 4c 20 | 52 65 73 6f 6c 76 65 4d |/..BOOL |ResolveM|
|00000de0| 79 41 6c 69 61 73 28 46 | 53 53 70 65 63 50 74 72 |yAlias(F|SSpecPtr|
|00000df0| 20 69 6e 69 74 46 53 53 | 70 65 63 29 0d 7b 0d 09 | initFSS|pec).{..|
|00000e00| 48 61 6e 64 6c 65 20 68 | 3b 0d 09 4f 53 45 72 72 |Handle h|;..OSErr|
|00000e10| 20 65 72 72 3b 0d 09 42 | 4f 4f 4c 20 77 61 73 43 | err;..B|OOL wasC|
|00000e20| 68 61 6e 67 65 64 3b 0d | 09 0d 09 2f 2f 20 67 65 |hanged;.|...// ge|
|00000e30| 74 20 61 6c 69 61 73 0d | 09 0d 09 68 3d 47 65 74 |t alias.|...h=Get|
|00000e40| 31 52 65 73 6f 75 72 63 | 65 28 72 41 6c 69 61 73 |1Resourc|e(rAlias|
|00000e50| 54 79 70 65 2c 49 4e 49 | 54 5f 41 4c 49 41 53 29 |Type,INI|T_ALIAS)|
|00000e60| 3b 0d 09 69 66 28 20 68 | 3d 3d 4e 49 4c 20 29 20 |;..if( h|==NIL ) |
|00000e70| 7b 0d 09 09 65 70 72 69 | 6e 74 66 28 22 43 61 6e |{...epri|ntf("Can|
|00000e80| 6e 6f 74 20 66 69 6e 64 | 20 41 6c 69 61 73 20 69 |not find| Alias i|
|00000e90| 6e 20 72 65 73 6f 75 72 | 63 65 20 66 6f 72 6b 2e |n resour|ce fork.|
|00000ea0| 22 29 3b 0d 09 09 72 65 | 74 75 72 6e 20 46 41 4c |");...re|turn FAL|
|00000eb0| 53 45 3b 0d 09 7d 0d 09 | 0d 09 2f 2f 20 72 65 73 |SE;..}..|..// res|
|00000ec0| 6f 6c 76 65 20 61 6c 69 | 61 73 0d 09 0d 09 65 72 |olve ali|as....er|
|00000ed0| 72 3d 52 65 73 6f 6c 76 | 65 41 6c 69 61 73 28 4e |r=Resolv|eAlias(N|
|00000ee0| 49 4c 2c 28 41 6c 69 61 | 73 48 61 6e 64 6c 65 29 |IL,(Alia|sHandle)|
|00000ef0| 68 2c 69 6e 69 74 46 53 | 53 70 65 63 2c 26 77 61 |h,initFS|Spec,&wa|
|00000f00| 73 43 68 61 6e 67 65 64 | 29 3b 0d 09 69 66 28 65 |sChanged|);..if(e|
|00000f10| 72 72 21 3d 6e 6f 45 72 | 72 29 20 7b 0d 09 09 65 |rr!=noEr|r) {...e|
|00000f20| 70 72 69 6e 74 66 28 22 | 43 61 6e 6e 6f 74 20 72 |printf("|Cannot r|
|00000f30| 65 73 6f 6c 76 65 20 41 | 6c 69 61 73 2e 5c 6e 28 |esolve A|lias.\n(|
|00000f40| 65 72 72 3d 25 64 29 22 | 2c 65 72 72 29 3b 0d 09 |err=%d)"|,err);..|
|00000f50| 09 72 65 74 75 72 6e 20 | 46 41 4c 53 45 3b 0d 09 |.return |FALSE;..|
|00000f60| 7d 0d 09 0d 09 2f 2f 20 | 6d 61 79 62 65 20 75 70 |}....// |maybe up|
|00000f70| 64 61 74 65 20 61 6c 69 | 61 73 0d 09 0d 09 69 66 |date ali|as....if|
|00000f80| 28 20 77 61 73 43 68 61 | 6e 67 65 64 20 29 20 7b |( wasCha|nged ) {|
|00000f90| 0d 09 09 43 68 61 6e 67 | 65 64 52 65 73 6f 75 72 |...Chang|edResour|
|00000fa0| 63 65 28 68 29 3b 0d 09 | 09 55 70 64 61 74 65 52 |ce(h);..|.UpdateR|
|00000fb0| 65 73 46 69 6c 65 28 43 | 75 72 52 65 73 46 69 6c |esFile(C|urResFil|
|00000fc0| 65 28 29 29 3b 0d 09 09 | 65 72 72 3d 52 65 73 45 |e());...|err=ResE|
|00000fd0| 72 72 6f 72 28 29 3b 0d | 09 09 69 66 28 20 65 72 |rror();.|..if( er|
|00000fe0| 72 21 3d 6e 6f 45 72 72 | 20 29 0d 09 09 09 65 70 |r!=noErr| )....ep|
|00000ff0| 72 69 6e 74 66 28 22 43 | 61 6e 6e 6f 74 20 77 72 |rintf("C|annot wr|
|00001000| 69 74 65 20 62 61 63 6b | 20 75 70 64 61 74 65 64 |ite back| updated|
|00001010| 20 41 6c 69 61 73 2e 5c | 6e 28 65 72 72 3d 25 64 | Alias.\|n(err=%d|
|00001020| 29 22 2c 65 72 72 29 3b | 0d 09 7d 0d 09 0d 09 52 |)",err);|..}....R|
|00001030| 65 6c 65 61 73 65 52 65 | 73 6f 75 72 63 65 28 68 |eleaseRe|source(h|
|00001040| 29 3b 0d 09 0d 09 72 65 | 74 75 72 6e 20 54 52 55 |);....re|turn TRU|
|00001050| 45 3b 0d 7d 0d 0d 2f 2a | 20 63 68 65 63 6b 20 69 |E;.}../*| check i|
|00001060| 66 20 61 20 6d 6f 64 69 | 66 69 65 72 20 6b 65 79 |f a modi|fier key|
|00001070| 20 69 73 20 70 72 65 73 | 73 65 64 20 2a 2f 0d 0d | is pres|sed */..|
|00001080| 42 4f 4f 4c 20 6d 6f 64 | 69 66 69 65 72 28 57 4f |BOOL mod|ifier(WO|
|00001090| 52 44 20 6d 61 73 6b 29 | 0d 7b 0d 09 45 76 65 6e |RD mask)|.{..Even|
|000010a0| 74 52 65 63 6f 72 64 20 | 74 68 65 45 76 65 6e 74 |tRecord |theEvent|
|000010b0| 3b 0d 09 0d 09 45 76 65 | 6e 74 41 76 61 69 6c 28 |;....Eve|ntAvail(|
|000010c0| 65 76 65 72 79 45 76 65 | 6e 74 2c 20 26 74 68 65 |everyEve|nt, &the|
|000010d0| 45 76 65 6e 74 29 3b 0d | 09 69 66 28 20 74 68 65 |Event);.|.if( the|
|000010e0| 45 76 65 6e 74 2e 6d 6f | 64 69 66 69 65 72 73 20 |Event.mo|difiers |
|000010f0| 26 20 6d 61 73 6b 20 29 | 0d 09 09 72 65 74 75 72 |& mask )|...retur|
|00001100| 6e 20 54 52 55 45 3b 0d | 09 65 6c 73 65 0d 09 09 |n TRUE;.|.else...|
|00001110| 72 65 74 75 72 6e 20 46 | 41 4c 53 45 3b 0d 7d 0d |return F|ALSE;.}.|
|00001120| 0d 2f 2f 20 74 68 69 73 | 20 69 73 20 74 68 65 20 |.// this| is the |
|00001130| 77 68 6f 6c 65 20 6d 61 | 67 69 63 20 74 6f 20 6c |whole ma|gic to l|
|00001140| 6f 61 64 20 74 68 65 20 | 41 70 70 6c 65 20 43 44 |oad the |Apple CD|
|00001150| 2d 52 4f 4d 20 44 72 69 | 76 65 72 0d 0d 42 4f 4f |-ROM Dri|ver..BOO|
|00001160| 4c 20 4c 6f 61 64 49 6e | 69 74 28 46 53 53 70 65 |L LoadIn|it(FSSpe|
|00001170| 63 50 74 72 20 69 6e 69 | 74 46 53 53 70 65 63 29 |cPtr ini|tFSSpec)|
|00001180| 0d 7b 0d 09 57 4f 52 44 | 20 72 65 66 4e 75 6d 2c |.{..WORD| refNum,|
|00001190| 72 65 74 3b 0d 09 48 61 | 6e 64 6c 65 20 68 64 6c |ret;..Ha|ndle hdl|
|000011a0| 3b 0d 09 4f 53 45 72 72 | 20 65 72 72 3b 0d 09 42 |;..OSErr| err;..B|
|000011b0| 59 54 45 20 6e 61 6d 65 | 5b 35 30 5d 3b 0d 09 0d |YTE name|[50];...|
|000011c0| 09 2f 2f 20 67 65 74 20 | 64 72 69 76 65 72 20 6e |.// get |driver n|
|000011d0| 61 6d 65 0d 09 0d 09 6e | 61 6d 65 5b 30 5d 3d 30 |ame....n|ame[0]=0|
|000011e0| 3b 0d 09 68 64 6c 3d 47 | 65 74 31 52 65 73 6f 75 |;..hdl=G|et1Resou|
|000011f0| 72 63 65 28 27 53 54 52 | 20 27 2c 44 72 69 76 65 |rce('STR| ',Drive|
|00001200| 72 4e 61 6d 65 29 3b 0d | 09 69 66 28 68 64 6c 29 |rName);.|.if(hdl)|
|00001210| 20 7b 0d 09 09 50 4c 73 | 74 72 63 70 79 28 6e 61 | {...PLs|trcpy(na|
|00001220| 6d 65 2c 20 2a 68 64 6c | 29 3b 0d 09 09 52 65 6c |me, *hdl|);...Rel|
|00001230| 65 61 73 65 52 65 73 6f | 75 72 63 65 28 68 64 6c |easeReso|urce(hdl|
|00001240| 29 3b 0d 09 7d 0d 09 0d | 09 2f 2f 20 6c 6f 6f 6b |);..}...|.// look|
|00001250| 20 66 6f 72 20 64 72 69 | 76 65 72 0d 09 0d 09 69 | for dri|ver....i|
|00001260| 66 28 6e 61 6d 65 5b 30 | 5d 29 09 7b 0d 09 09 69 |f(name[0|]).{...i|
|00001270| 66 28 4f 70 65 6e 44 72 | 69 76 65 72 28 6e 61 6d |f(OpenDr|iver(nam|
|00001280| 65 2c 26 72 65 66 4e 75 | 6d 29 20 3d 3d 20 6e 6f |e,&refNu|m) == no|
|00001290| 45 72 72 29 20 7b 0d 09 | 09 09 70 32 63 73 74 72 |Err) {..|..p2cstr|
|000012a0| 28 6e 61 6d 65 29 3b 0d | 09 09 09 65 70 72 69 6e |(name);.|...eprin|
|000012b0| 74 66 28 22 44 72 69 76 | 65 72 20 27 25 73 27 20 |tf("Driv|er '%s' |
|000012c0| 61 6c 72 65 61 64 79 20 | 6c 6f 61 64 65 64 2e 22 |already |loaded."|
|000012d0| 2c 6e 61 6d 65 29 3b 0d | 09 09 09 72 65 74 75 72 |,name);.|...retur|
|000012e0| 6e 20 46 41 4c 53 45 3b | 0d 09 09 7d 0d 09 7d 0d |n FALSE;|...}..}.|
|000012f0| 09 0d 09 0d 09 2f 2f 20 | 6f 70 65 6e 20 72 65 73 |.....// |open res|
|00001300| 6f 75 72 63 65 20 66 6f | 72 6b 0d 09 0d 09 72 65 |ource fo|rk....re|
|00001310| 66 4e 75 6d 3d 46 53 70 | 4f 70 65 6e 52 65 73 46 |fNum=FSp|OpenResF|
|00001320| 69 6c 65 28 69 6e 69 74 | 46 53 53 70 65 63 2c 20 |ile(init|FSSpec, |
|00001330| 66 73 43 75 72 50 65 72 | 6d 29 3b 0d 09 65 72 72 |fsCurPer|m);..err|
|00001340| 3d 52 65 73 45 72 72 6f | 72 28 29 3b 0d 09 69 66 |=ResErro|r();..if|
|00001350| 28 72 65 66 4e 75 6d 20 | 3d 3d 20 2d 31 20 7c 7c |(refNum |== -1 |||
|00001360| 20 65 72 72 21 3d 6e 6f | 45 72 72 29 20 7b 0d 09 | err!=no|Err) {..|
|00001370| 09 65 70 72 69 6e 74 66 | 28 22 43 61 6e 6e 6f 74 |.eprintf|("Cannot|
|00001380| 20 6f 70 65 6e 20 66 69 | 6c 65 20 27 25 73 27 2e | open fi|le '%s'.|
|00001390| 5c 6e 28 65 72 72 3d 25 | 64 29 22 2c 20 69 6e 69 |\n(err=%|d)", ini|
|000013a0| 74 46 53 53 70 65 63 2d | 3e 6e 61 6d 65 2c 20 65 |tFSSpec-|>name, e|
|000013b0| 72 72 29 3b 0d 09 09 72 | 65 74 75 72 6e 20 46 41 |rr);...r|eturn FA|
|000013c0| 4c 53 45 3b 0d 09 7d 0d | 09 0d 09 2f 2f 20 6c 6f |LSE;..}.|...// lo|
|000013d0| 61 64 20 49 4e 49 54 0d | 09 0d 09 68 64 6c 3d 47 |ad INIT.|...hdl=G|
|000013e0| 65 74 31 49 6e 64 52 65 | 73 6f 75 72 63 65 28 27 |et1IndRe|source('|
|000013f0| 49 4e 49 54 27 2c 31 29 | 3b 0d 09 69 66 28 68 64 |INIT',1)|;..if(hd|
|00001400| 6c 3d 3d 30 29 20 7b 20 | 0d 09 09 65 70 72 69 6e |l==0) { |...eprin|
|00001410| 74 66 28 22 43 61 6e 6e | 6f 74 20 6c 6f 61 64 20 |tf("Cann|ot load |
|00001420| 49 4e 49 54 20 66 72 6f | 6d 20 64 72 69 76 65 72 |INIT fro|m driver|
|00001430| 2e 22 29 3b 0d 09 09 43 | 6c 6f 73 65 52 65 73 46 |.");...C|loseResF|
|00001440| 69 6c 65 28 72 65 66 4e | 75 6d 29 3b 0d 09 09 72 |ile(refN|um);...r|
|00001450| 65 74 75 72 6e 20 46 41 | 4c 53 45 3b 0d 09 7d 0d |eturn FA|LSE;..}.|
|00001460| 09 48 4c 6f 63 6b 28 68 | 64 6c 29 3b 0d 09 53 65 |.HLock(h|dl);..Se|
|00001470| 74 5a 6f 6e 65 28 53 79 | 73 74 65 6d 5a 6f 6e 65 |tZone(Sy|stemZone|
|00001480| 28 29 29 3b 0d 09 0d 09 | 2f 2f 20 72 75 6e 20 49 |());....|// run I|
|00001490| 4e 49 54 20 69 6e 20 53 | 79 73 74 65 6d 20 5a 6f |NIT in S|ystem Zo|
|000014a0| 6e 65 0d 09 0d 09 72 65 | 74 3d 28 2a 28 57 4f 52 |ne....re|t=(*(WOR|
|000014b0| 44 28 2a 29 28 29 29 28 | 2a 68 64 6c 29 29 28 29 |D(*)())(|*hdl))()|
|000014c0| 3b 0d 09 0d 09 53 65 74 | 5a 6f 6e 65 28 41 70 70 |;....Set|Zone(App|
|000014d0| 6c 69 63 5a 6f 6e 65 28 | 29 29 3b 0d 09 48 55 6e |licZone(|));..HUn|
|000014e0| 6c 6f 63 6b 28 68 64 6c | 29 3b 0d 09 52 65 6c 65 |lock(hdl|);..Rele|
|000014f0| 61 73 65 52 65 73 6f 75 | 72 63 65 28 68 64 6c 29 |aseResou|rce(hdl)|
|00001500| 3b 0d 09 43 6c 6f 73 65 | 52 65 73 46 69 6c 65 28 |;..Close|ResFile(|
|00001510| 72 65 66 4e 75 6d 29 3b | 0d 09 0d 09 69 66 28 72 |refNum);|....if(r|
|00001520| 65 74 29 20 7b 20 2f 2f | 20 72 65 74 75 72 6e 20 |et) { //| return |
|00001530| 63 6f 64 65 20 61 6c 77 | 61 79 73 20 30 20 3f 0d |code alw|ays 0 ?.|
|00001540| 09 09 65 70 72 69 6e 74 | 66 28 22 43 61 6e 6e 6f |..eprint|f("Canno|
|00001550| 74 20 69 6e 69 74 69 61 | 6c 69 7a 65 20 44 72 69 |t initia|lize Dri|
|00001560| 76 65 72 2e 5c 6e 28 65 | 72 72 3d 25 64 29 22 2c |ver.\n(e|rr=%d)",|
|00001570| 72 65 74 29 3b 0d 09 09 | 72 65 74 75 72 6e 20 46 |ret);...|return F|
|00001580| 41 4c 53 45 3b 0d 09 7d | 0d 09 0d 09 2f 2f 20 6c |ALSE;..}|....// l|
|00001590| 6f 6f 6b 20 66 6f 72 20 | 64 72 69 76 65 72 0d 09 |ook for |driver..|
|000015a0| 0d 09 69 66 28 6e 61 6d | 65 5b 30 5d 29 09 7b 0d |..if(nam|e[0]).{.|
|000015b0| 09 09 69 66 28 4f 70 65 | 6e 44 72 69 76 65 72 28 |..if(Ope|nDriver(|
|000015c0| 6e 61 6d 65 2c 26 72 65 | 66 4e 75 6d 29 20 21 3d |name,&re|fNum) !=|
|000015d0| 20 6e 6f 45 72 72 29 20 | 7b 0d 09 09 09 70 32 63 | noErr) |{....p2c|
|000015e0| 73 74 72 28 6e 61 6d 65 | 29 3b 0d 09 09 09 65 70 |str(name|);....ep|
|000015f0| 72 69 6e 74 66 28 22 44 | 72 69 76 65 72 20 27 25 |rintf("D|river '%|
|00001600| 73 27 20 6e 6f 74 20 6c | 6f 61 64 65 64 2e 22 2c |s' not l|oaded.",|
|00001610| 6e 61 6d 65 29 3b 0d 09 | 09 09 72 65 74 75 72 6e |name);..|..return|
|00001620| 20 46 41 4c 53 45 3b 0d | 09 09 7d 0d 09 7d 0d 09 | FALSE;.|..}..}..|
|00001630| 0d 09 72 65 74 75 72 6e | 20 54 52 55 45 3b 0d 7d |..return| TRUE;.}|
|00001640| 0d 0d 6d 61 69 6e 28 29 | 0d 7b 0d 09 48 61 6e 64 |..main()|.{..Hand|
|00001650| 6c 65 20 68 64 6c 3b 0d | 09 46 53 53 70 65 63 20 |le hdl;.|.FSSpec |
|00001660| 69 6e 69 74 46 53 53 70 | 65 63 3b 0d 09 4c 4f 4e |initFSSp|ec;..LON|
|00001670| 47 20 67 65 73 52 65 73 | 70 6f 6e 73 65 3b 0d 09 |G gesRes|ponse;..|
|00001680| 0d 09 2f 2f 20 69 6e 69 | 74 69 61 6c 69 73 61 74 |..// ini|tialisat|
|00001690| 69 6f 6e 0d 09 0d 09 4d | 61 78 41 70 70 6c 5a 6f |ion....M|axApplZo|
|000016a0| 6e 65 28 29 3b 09 0d 09 | 49 6e 69 74 47 72 61 66 |ne();...|InitGraf|
|000016b0| 28 26 71 64 2e 74 68 65 | 50 6f 72 74 29 3b 0d 09 |(&qd.the|Port);..|
|000016c0| 49 6e 69 74 46 6f 6e 74 | 73 28 29 3b 0d 09 46 6c |InitFont|s();..Fl|
|000016d0| 75 73 68 45 76 65 6e 74 | 73 28 65 76 65 72 79 45 |ushEvent|s(everyE|
|000016e0| 76 65 6e 74 2c 20 30 29 | 3b 0d 09 49 6e 69 74 57 |vent, 0)|;..InitW|
|000016f0| 69 6e 64 6f 77 73 28 29 | 3b 0d 09 49 6e 69 74 4d |indows()|;..InitM|
|00001700| 65 6e 75 73 28 29 3b 0d | 09 54 45 49 6e 69 74 28 |enus();.|.TEInit(|
|00001710| 29 3b 0d 09 49 6e 69 74 | 44 69 61 6c 6f 67 73 28 |);..Init|Dialogs(|
|00001720| 6e 69 6c 29 3b 0d 09 49 | 6e 69 74 43 75 72 73 6f |nil);..I|nitCurso|
|00001730| 72 28 29 3b 0d 09 09 0d | 09 2f 2f 20 63 68 65 63 |r();....|.// chec|
|00001740| 6b 20 66 6f 72 20 65 73 | 73 65 6e 74 69 61 6c 20 |k for es|sential |
|00001750| 4d 61 6e 67 65 72 73 0d | 09 0d 09 69 66 20 28 20 |Mangers.|...if ( |
|00001760| 47 65 73 74 61 6c 74 20 | 28 67 65 73 74 61 6c 74 |Gestalt |(gestalt|
|00001770| 46 53 41 74 74 72 2c 20 | 26 67 65 73 52 65 73 70 |FSAttr, |&gesResp|
|00001780| 6f 6e 73 65 29 20 7c 7c | 20 21 42 69 74 54 73 74 |onse) ||| !BitTst|
|00001790| 28 26 67 65 73 52 65 73 | 70 6f 6e 73 65 2c 33 31 |(&gesRes|ponse,31|
|000017a0| 20 2d 20 67 65 73 74 61 | 6c 74 46 75 6c 6c 45 78 | - gesta|ltFullEx|
|000017b0| 74 46 53 44 69 73 70 61 | 74 63 68 69 6e 67 29 20 |tFSDispa|tching) |
|000017c0| 7c 7c 0d 09 20 21 42 69 | 74 54 73 74 28 26 67 65 |||.. !Bi|tTst(&ge|
|000017d0| 73 52 65 73 70 6f 6e 73 | 65 2c 33 31 20 2d 20 67 |sRespons|e,31 - g|
|000017e0| 65 73 74 61 6c 74 48 61 | 73 46 53 53 70 65 63 43 |estaltHa|sFSSpecC|
|000017f0| 61 6c 6c 73 29 20 7c 7c | 0d 09 20 47 65 73 74 61 |alls) |||.. Gesta|
|00001800| 6c 74 20 28 67 65 73 74 | 61 6c 74 41 6c 69 61 73 |lt (gest|altAlias|
|00001810| 4d 67 72 41 74 74 72 2c | 20 26 67 65 73 52 65 73 |MgrAttr,| &gesRes|
|00001820| 70 6f 6e 73 65 29 20 7c | 7c 20 21 42 69 74 54 73 |ponse) ||| !BitTs|
|00001830| 74 28 26 67 65 73 52 65 | 73 70 6f 6e 73 65 2c 33 |t(&gesRe|sponse,3|
|00001840| 31 20 2d 20 67 65 73 74 | 61 6c 74 41 6c 69 61 73 |1 - gest|altAlias|
|00001850| 4d 67 72 50 72 65 73 65 | 6e 74 29 20 29 20 7b 0d |MgrPrese|nt) ) {.|
|00001860| 09 20 09 65 70 72 69 6e | 74 66 28 22 59 6f 75 20 |. .eprin|tf("You |
|00001870| 6e 65 65 64 20 74 68 65 | 20 41 6c 69 61 73 20 4d |need the| Alias M|
|00001880| 61 6e 61 67 65 72 20 61 | 6e 64 20 74 68 65 20 46 |anager a|nd the F|
|00001890| 69 6c 65 20 4d 61 6e 61 | 67 65 72 20 66 6f 72 20 |ile Mana|ger for |
|000018a0| 27 4c 6f 61 64 41 44 72 | 69 76 65 27 20 74 6f 20 |'LoadADr|ive' to |
|000018b0| 72 75 6e 2e 22 29 3b 0d | 09 09 72 65 74 75 72 6e |run.");.|..return|
|000018c0| 3b 0d 09 7d 0d 09 0d 09 | 2f 2f 20 63 6f 6d 6d 61 |;..}....|// comma|
|000018d0| 6e 64 20 6b 65 79 20 64 | 6f 77 6e 3a 20 61 6c 77 |nd key d|own: alw|
|000018e0| 61 79 73 20 61 73 6b 20 | 66 6f 72 20 66 69 6c 65 |ays ask |for file|
|000018f0| 0d 09 0d 09 69 66 28 6d | 6f 64 69 66 69 65 72 28 |....if(m|odifier(|
|00001900| 63 6d 64 4b 65 79 29 29 | 0d 09 09 68 64 6c 3d 4e |cmdKey))|...hdl=N|
|00001910| 49 4c 3b 0d 09 65 6c 73 | 65 0d 09 09 68 64 6c 3d |IL;..els|e...hdl=|
|00001920| 47 65 74 31 52 65 73 6f | 75 72 63 65 28 72 41 6c |Get1Reso|urce(rAl|
|00001930| 69 61 73 54 79 70 65 2c | 49 4e 49 54 5f 41 4c 49 |iasType,|INIT_ALI|
|00001940| 41 53 29 3b 0d 09 69 66 | 28 20 68 64 6c 3d 3d 4e |AS);..if|( hdl==N|
|00001950| 49 4c 20 29 20 7b 0d 09 | 09 65 70 72 69 6e 74 66 |IL ) {..|.eprintf|
|00001960| 28 22 4c 6f 61 64 41 44 | 72 69 76 65 20 56 20 31 |("LoadAD|rive V 1|
|00001970| 2e 30 5c 6e 5c 6e 46 72 | 65 65 77 61 72 65 20 62 |.0\n\nFr|eeware b|
|00001980| 79 20 44 69 65 74 65 72 | 20 53 70 61 61 72 5c 6e |y Dieter| Spaar\n|
|00001990| 43 6f 6d 6d 65 72 63 69 | 61 6c 20 75 73 65 20 6d |Commerci|al use m|
|000019a0| 75 73 74 20 62 65 20 6c | 69 63 65 6e 73 65 64 2e |ust be l|icensed.|
|000019b0| 5c 6e 49 6e 74 65 72 4e | 65 74 3a 20 73 70 61 61 |\nInterN|et: spaa|
|000019c0| 72 40 6d 69 72 69 64 65 | 72 2e 61 62 67 2e 73 75 |r@miride|r.abg.su|
|000019d0| 62 2e 6f 72 67 22 29 3b | 0d 09 09 65 70 72 69 6e |b.org");|...eprin|
|000019e0| 74 66 28 22 4d 6f 75 6e | 74 20 43 44 2d 52 4f 4d |tf("Moun|t CD-ROM|
|000019f0| 20 77 69 74 68 6f 75 74 | 20 52 65 73 74 61 72 74 | without| Restart|
|00001a00| 2e 20 53 65 6c 65 63 74 | 20 74 68 65 20 43 44 2d |. Select| the CD-|
|00001a10| 52 4f 4d 20 44 72 69 76 | 65 72 20 6e 6f 77 2e 22 |ROM Driv|er now."|
|00001a20| 29 3b 0d 09 09 69 66 28 | 21 4d 61 6b 65 4d 79 41 |);...if(|!MakeMyA|
|00001a30| 6c 69 61 73 28 29 29 0d | 09 09 09 72 65 74 75 72 |lias()).|...retur|
|00001a40| 6e 3b 0d 09 7d 0d 09 65 | 6c 73 65 0d 09 09 52 65 |n;..}..e|lse...Re|
|00001a50| 6c 65 61 73 65 52 65 73 | 6f 75 72 63 65 28 68 64 |leaseRes|ource(hd|
|00001a60| 6c 29 3b 0d 09 0d 09 2f | 2f 20 67 65 74 20 46 53 |l);..../|/ get FS|
|00001a70| 53 50 65 63 20 6f 66 20 | 66 69 6c 65 0d 09 0d 09 |SPec of |file....|
|00001a80| 69 66 28 21 52 65 73 6f | 6c 76 65 4d 79 41 6c 69 |if(!Reso|lveMyAli|
|00001a90| 61 73 28 26 69 6e 69 74 | 46 53 53 70 65 63 29 29 |as(&init|FSSpec))|
|00001aa0| 20 7b 0d 09 09 65 70 72 | 69 6e 74 66 28 22 53 65 | {...epr|intf("Se|
|00001ab0| 6c 65 63 74 20 74 68 65 | 20 43 44 2d 52 4f 4d 20 |lect the| CD-ROM |
|00001ac0| 44 72 69 76 65 72 20 6e | 6f 77 2e 22 29 3b 0d 09 |Driver n|ow.");..|
|00001ad0| 09 69 66 28 21 4d 61 6b | 65 4d 79 41 6c 69 61 73 |.if(!Mak|eMyAlias|
|00001ae0| 28 29 29 0d 09 09 09 72 | 65 74 75 72 6e 3b 0d 09 |())....r|eturn;..|
|00001af0| 7d 0d 09 0d 09 2f 2f 20 | 61 6e 64 20 6e 6f 77 20 |}....// |and now |
|00001b00| 6c 6f 61 64 20 74 68 65 | 20 66 69 6c 65 0d 09 0d |load the| file...|
|00001b10| 09 4c 6f 61 64 49 6e 69 | 74 28 26 69 6e 69 74 46 |.LoadIni|t(&initF|
|00001b20| 53 53 70 65 63 29 3b 0d | 7d 00 00 00 00 00 00 00 |SSpec);.|}.......|
|00001b30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001b80| 00 00 01 00 00 00 01 6e | 00 00 00 6e 00 00 00 3e |.......n|...n...>|
|00001b90| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001ba0| 00 00 00 00 00 00 00 00 | 00 00 00 00 a4 00 00 00 |........|........|
|00001bb0| 0c 4c 6f 61 64 41 44 72 | 69 76 65 2e 63 72 02 00 |.LoadADr|ive.cr..|
|00001bc0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00001bd0| 00 00 50 61 72 74 53 49 | 54 78 00 00 00 00 00 00 |..PartSI|Tx......|
|00001be0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001bf0| 00 00 a9 c8 84 cc 00 00 | 00 00 00 00 01 ac 46 69 |........|......Fi|
|00001c00| 6c 6c 65 72 42 42 49 54 | 07 43 6f 6e 74 72 6f 6c |llerBBIT|.Control|
|00001c10| 42 42 49 54 06 4f 70 74 | 69 6f 6e 42 42 49 54 06 |BBIT.Opt|ionBBIT.|
|00001c20| 46 69 6c 6c 65 72 42 42 | 49 54 05 53 68 69 66 74 |FillerBB|IT.Shift|
|00001c30| 42 42 49 54 07 43 6f 6d | 6d 61 6e 64 42 42 49 54 |BBIT.Com|mandBBIT|
|00001c40| 05 2a 2a 2a 2a 2a 4c 53 | 54 45 00 00 00 02 00 00 |.*****LS|TE......|
|00001c50| 00 00 00 02 00 00 00 00 | 00 08 43 4f 44 45 01 00 |........|..CODE..|
|00001c60| 00 00 00 00 00 08 43 4f | 44 45 01 00 00 00 00 00 |......CO|DE......|
|00001c70| 00 02 04 00 00 00 00 08 | 00 02 01 00 00 81 00 81 |........|........|
|00001c80| 00 00 00 48 00 09 50 72 | 6f 46 6f 6e 74 00 61 6e |...H..Pr|oFont.an|
|00001c90| 64 61 72 64 46 69 6c 65 | 2e 68 3e 0d 23 69 6e 63 |dardFile|.h>.#inc|
|00001ca0| 6c 75 64 65 09 3c 00 06 | 00 04 00 3c 00 24 03 2b |lude.<..|...<.$.+|
|00001cb0| 04 02 00 3c 00 24 03 2b | 04 02 a9 bc 5f 2d 00 00 |...<.$.+|...._-..|
|00001cc0| 1a 6e 00 00 1a 6e 00 00 | 15 ff 01 00 00 00 00 1e |.n...n..|........|
|00001cd0| 00 3c 00 24 03 2b 04 02 | 00 3c 00 24 03 2b 04 02 |.<.$.+..|.<.$.+..|
|00001ce0| 00 00 15 ff 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001cf0| 01 00 00 00 01 6e 00 00 | 00 6e 00 00 00 3e 00 b8 |.....n..|.n...>..|
|00001d00| 31 38 13 1a 00 00 00 1c | 00 3e 00 00 4d 50 53 52 |18......|.>..MPSR|
|00001d10| 00 01 00 0a 03 ed ff ff | 00 00 00 00 00 00 00 00 |........|........|
|00001d20| 03 f0 ff ff 00 00 00 4c | 00 ba 8b 44 00 00 00 00 |.......L|...D....|
|00001d30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00001d70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+